package cn.attackme.myuploader.model;


import com.fasterxml.jackson.annotation.JsonFormat;


import lombok.AllArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * File表存储上传的文件信息
 */

@Table(name="T_ICON_LIBRARY") // 数据库表名
@AllArgsConstructor
@ToString
public class Icon implements Serializable {

    private static final long serialVersionUID = -6956947981866795431L;

    @Id
    private String id;
    @Column(name = "name")
    private String name;
    @Column(name = "md5")
    private String md5;
    @Column(name = "iconImage")
    private String iconImage;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "uploadtime")
    private Date uploadTime;

    public Icon() {
    }

    public Icon(String name, String md5, String iconImage, Date uploadTime) {
        this.name = name;
        this.md5 = md5;
        this.iconImage = iconImage;
        this.uploadTime = uploadTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public String getIconImage() {
        return iconImage;
    }

    public void setIconImage(String iconImage) {
        this.iconImage = iconImage;
    }

    public Date getUploadTime() {
        return uploadTime;
    }

    public void setUploadTime(Date uploadTime) {
        this.uploadTime = uploadTime;
    }
}
